-
Notifications
You must be signed in to change notification settings - Fork 11
🤖 Add NPM publishing with OIDC trusted publishing #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add GitHub Actions workflow for hybrid NPM publishing - Publishes to 'next' tag on main branch commits - Publishes to 'latest' tag on git tag releases - Uses OIDC trusted publishing (no long-lived tokens) - Includes provenance attestations for supply chain security - Update package.json for NPM publishing - Change package name to @coder/cmux (scoped package) - Add bin field for CLI usage - Add repository and publishConfig fields - Add files array to control what gets published (whitelist approach) Generated with cmux
602b6f2 to
2ddc193
Compare
💡 Codex ReviewLines 138 to 143 in 602b6f2
The new ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
- Add shebang to src/main.ts so it's executable as a CLI - Auto-detect execution context: CLI vs Electron - Default to server mode when run via npm/npx (no Electron deps needed) - Preserve Electron desktop mode when launched as Electron app This makes 'npx @coder/cmux' work out of the box without requiring Electron dependencies or 'server' argument. Generated with cmux
4325092 to
18d9ed4
Compare
- Move cors, express, ws from devDependencies to dependencies - These are required at runtime for server mode to work - Fixes 'cors cannot be found' error when running as npm package
18d9ed4 to
e299160
Compare
React, emotion, markdown/mermaid rendering, and other UI packages are only needed for the Electron renderer, not the CLI/server. This reduces npm package install size and dependencies.
Users can now install the full Electron desktop app via npm: npm install -g @coder/cmux Running 'cmux' launches the desktop app by default. Running 'cmux server' runs the server mode. Added dist/assets/* and dist/**/*.css to published files for renderer.
The bin script now: - Detects if 'server' arg is passed and runs Node directly - Otherwise spawns the electron binary to launch the desktop app This makes 'cmux' launch the Electron app and 'cmux server' run server mode.
Provenance is auto-enabled via --provenance flag in CI workflow. Local manual publishing doesn't support it (needs GitHub Actions OIDC).
electron-builder requires electron to be in devDependencies only.
Summary
Adds automated NPM publishing to
@coder/cmuxusing modern OIDC trusted publishing (no long-lived tokens needed).Changes
GitHub Actions Workflow
@nexttag (pre-release)latesttag (stable)Package Configuration
@coder/cmux(scoped package)binfield fornpx @coder/cmuxusage.npmignore
Setup Required After Merge
First manual publish (one-time):
This creates the package on npmjs.com
Configure OIDC on npmjs.com (one-time):
codercmuxpublish-npm.ymlproductionDone! Future publishes happen automatically:
@nexttaglatesttagUsage Examples
After publishing:
References
Generated with cmux